package com.zhentao.controller;

import com.zhentao.pojo.Department;
import com.zhentao.service.DepartmentService;
import com.zhentao.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("findDepartment")
    public Result findDepartment(){
        List<Department> list = departmentService.list();
        return Result.OK(list);
    }
}
